package com.nsgf.library.data.api;

import com.nsgf.library.data.bean.AddressBean;
import com.nsgf.library.data.bean.BusinessBean;
import com.nsgf.library.data.bean.BusinessSettleTypeBean;
import com.nsgf.library.data.bean.Category;
import com.nsgf.library.data.bean.ConfirmOrderBean;
import com.nsgf.library.data.bean.LibraryInfo;
import com.nsgf.library.data.bean.MessageBean;
import com.nsgf.library.data.bean.OrderDetailBean;
import com.nsgf.library.data.bean.OrderListBean;
import com.nsgf.library.data.bean.PointListBean;
import com.nsgf.library.data.bean.ProductBean;
import com.nsgf.library.data.bean.ProductDetailBean;
import com.nsgf.library.data.bean.Shop;
import com.nsgf.library.data.bean.UserDataBean;
import com.nsgf.library.data.bean.XBannerBeanInfo;
import com.nsgf.library.data.response.ResponseStatus;
import com.stx.xhb.xbanner.entity.BaseBannerInfo;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Create by GC at 2025/5/23
 */
public interface AccountService {

    @POST("app/mag/AccAdmin/doLogin")
    Observable<ResponseStatus<UserDataBean>> login(@Body RequestBody body);

    @GET("member/auth/upgrade-information")
    Observable<ResponseStatus<Object>> getVersion();


    @GET("member/user/getUserDetail")
    Observable<ResponseStatus<UserDataBean>> getNewLoginInfo();

    @GET("app/message/list")
    Call<MessageBean> getMessage(@Query("type") String type,
                                 @Query("search") String search,
                                 @Query("projectCode") String projectCode);


    //-----------------------------------------------------------

    /**
     * 新人专享
     *
     * @param body
     * @return
     */
    @POST("promotion/coupon/queryDiscountedProducts")
    Observable<ResponseStatus<ProductBean>> queryDiscountedProducts(@Body RequestBody body);

    @GET("product/spu/getLunBoList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> getLunBoList();

    @POST("promotion/coupon/queryHotSales")
    Observable<ResponseStatus<ProductBean>> queryHotSales(@Body RequestBody body);

    @GET("product/spu/getSpuList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> getSpuList();

    @GET("product/spu/queryDirectStore")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<BusinessBean>>> queryDirectStore();

    @GET("product/spu/queryFranchiseStore")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<BusinessBean>>> queryFranchiseStore();

    @GET("product/spu/getZhanXuanList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> getZhanXuanList(@Query("pageNo") int pageNo,
                                                                  @Query("pageSize") int pageSize);

    @GET("product/spu/queryYouXuanList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> queryYouXuanList(@Query("pageNo") int pageNo,
                                                                   @Query("pageSize") int pageSize);

    @GET("product/spu/getYunDianList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> getYunDianList(@Query("pageNo") int pageNo,
                                                                 @Query("pageSize") int pageSize);

    @GET("product/spu/page")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<ProductBean>> getProductList(@Query("keyword") String keyword,
                                                           @Query("pageNo") int pageNo,
                                                           @Query("pageSize") int pageSize);

    @GET("product/spu/getTeGongList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> getTeGongList(@Query("pageNo") int pageNo,
                                                                @Query("pageSize") int pageSize);

    @GET("product/spu/get-detail")
    Observable<ResponseStatus<ProductDetailBean>> productDetails(@Query("id") String id);

    @GET("product/category/getAllProducts")
    Observable<ResponseStatus<List<Category>>> getAllProducts();


    @POST("member/auth/send-sms-code")
    Observable<ResponseStatus<String>> sendCode(@Body RequestBody body);

    @POST("member/auth/sms-login")
    Observable<ResponseStatus<UserDataBean>> loginCode(@Body RequestBody body);

    @POST("system/identify/login")
    Observable<ResponseStatus<UserDataBean>> businessLogin(@Body RequestBody body);


    @POST("trade/cart/add")
    Observable<ResponseStatus<String>> cartAdd(@Body RequestBody body);


    @GET("trade/cart/list")
    Observable<ResponseStatus<Shop>> cartList();

    @PUT("trade/cart/update-count")
    Observable<ResponseStatus<String>> cartUpdateCount(@Body RequestBody body);

    @GET("member/sign-in/config/list")
    Observable<ResponseStatus<List<LibraryInfo>>> getSignInList();


    @GET("member/sign-in/record/getSignInRecords")
    Observable<ResponseStatus<List<LibraryInfo>>> getSignInRecords();

    @GET("member/sign-in/record/queryUserPoint")
    Observable<ResponseStatus<LibraryInfo>> queryUserPoint();

    @GET("member/sign-in/record/get-summary")
    Observable<ResponseStatus<LibraryInfo>> getSignSummary();

    @POST("member/sign-in/record/create")
    Observable<ResponseStatus<Object>> createSignIn();


    @POST("trade/order/settlementByPost")
    Observable<ResponseStatus<ConfirmOrderBean>> settlement(@Body RequestBody body);


    @GET("member/address/list")
    Observable<ResponseStatus<List<AddressBean>>> getAddressList();


    @GET("member/user/inviterList")
    Observable<ResponseStatus<List<AddressBean>>> getInviterList();

    @POST("member/address/create")
    Observable<ResponseStatus<String>> createAddress(@Body RequestBody body);

    @PUT("member/address/update")
    Observable<ResponseStatus<String>> modifyAddress(@Body RequestBody body);

    @DELETE("member/address/delete")
    Observable<ResponseStatus<String>> deleteAddress(@Query("id") String id);

    @GET("member/address/get-default")
    Observable<ResponseStatus<AddressBean>> getDefaultAddress();

    @GET("member/address/get")
    Observable<ResponseStatus<AddressBean>> getAddress(@Query("id") String id);

    @GET("promotion/coupon/queryCoupons")
    Observable<ResponseStatus<List<ConfirmOrderBean.CouponsDTO>>> queryCoupons();

    @GET("member/user/sign-in-video")
    Observable<ResponseStatus<LibraryInfo>> getSignVideo();


    @GET("product/spu/queryTenantDetail")
    Observable<ResponseStatus<BusinessBean>> queryTenantDetail(@Query("id") String id);


    @GET("trade/order/page")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<OrderListBean>> getOrderList(@Query("pageNo") int pageNo,
                                                           @Query("pageSize") int pageSize,
                                                           @Query("status") String status);


    @DELETE("trade/order/delete")
    Observable<ResponseStatus<String>> deleteOrder(@Query("id") String id);

    @DELETE("trade/order/cancel")
    Observable<ResponseStatus<String>> cancelOrder(@Query("id") String id);

    @POST("trade/order/create")
    Observable<ResponseStatus<LibraryInfo>> createOrder(@Body RequestBody body);


    @GET("trade/order/get-detail")
    Observable<ResponseStatus<OrderDetailBean>> getOrderDetails(@Query("id") String id);


    @GET("trade/order/update-user-pay-status")
    Observable<ResponseStatus<String>> setUpdatePayStatus(@Query("id") String id);

    @POST("trade/after-sale/create-refunds-only")
    Observable<ResponseStatus<String>> refundOrder(@Body RequestBody body);


    /**
     * 福利积分
     *
     * @return
     */
    @POST("member/point/record/page")
    Observable<ResponseStatus<PointListBean>> getPointsBenefit(@Body RequestBody body);

    @GET("member/point/record/get-point-detail")
    Observable<ResponseStatus<UserDataBean>> getPointDetail();

    @GET("member/user/page")
    Observable<ResponseStatus<UserDataBean>> getUserRecord(@Query("pageNo") int pageNo,
                                                           @Query("pageSize") int pageSize,
                                                           @Query("keywords") String keywords);


    @GET("member/point/record/welfarepoints-transfer-fee")
    Observable<ResponseStatus<Object>> getWelfarePoints();

    /**
     * 获取消费积分转分红点比例
     *
     * @return
     */
    @GET("member/point/record/get-bonus-points-config")
    Observable<ResponseStatus<Object>> getBonusPointsConfig();

    /**
     * 消费积分转让费率
     *
     * @return
     */
    @GET("member/point/record/transfer-consumption-fee")
    Observable<ResponseStatus<Object>> transferConsumptionFee();

    //福利积分转让费率
    @GET("system/homepage/welfarepoints-transfer-fee")
    Observable<ResponseStatus<Object>> welfarepoints();

    @GET("system/homepage/transfer-consumption-fee")
    Observable<ResponseStatus<Object>> consumption();

    @POST("system/homepage/welfarepoints-transfer")
    Observable<ResponseStatus<String>> welfarePointsTransfer(@Body RequestBody body);

    @POST("member/point/record/welfarepoints-transfer")
    Observable<ResponseStatus<String>> welfarePointsUserTransfer(@Body RequestBody body);

    @POST("system/homepage/transfer-consumption-volume")
    Observable<ResponseStatus<String>> transferConsumption(@Body RequestBody body);

    /**
     * 消费积分兑换分红点
     *
     * @param body
     * @return
     */
    @POST("member/point/record/redeem-bonus-points")
    Observable<ResponseStatus<String>> redeemBonusPoints(@Body RequestBody body);

    @POST("member/point/record/transfer-consumption-volume")
    Observable<ResponseStatus<String>> transferConsumptionVolume(@Body RequestBody body);

    /**
     * 惠通宝转让费率
     *
     * @return
     */
    @GET("member/point/record/huitongbao-transfer-fee")
    Observable<ResponseStatus<Object>> getHTBTransferFee();

    @GET("member/point/record/get-Huitongbao-transfer-points-config")
    Observable<ResponseStatus<Object>> getHTBTransferPointsConfig();

    @GET("system/notice/getNotices")
    Observable<ResponseStatus<List<MessageBean.DataBean>>> getNotices();

    @POST("system/tenant/addTenant")
    Observable<ResponseStatus<String>> addTenant(@Body RequestBody body);

    @Multipart
    @POST("infra/file/upload")
    Observable<ResponseStatus<Object>> uploadFile(@Part MultipartBody.Part file);

    @GET("system/tenant/getShopTypes")
    Observable<ResponseStatus<List<LibraryInfo>>> getShopTypes();

    @GET("system/tenant/queryServiceCenters")
    Observable<ResponseStatus<List<BusinessBean>>> queryServiceCenters();

    @GET("system/tenant/getTenantTypes")
    Observable<ResponseStatus<List<BusinessSettleTypeBean>>> getTenantTypes();


    @GET("system/tenant/getRecord")
    Observable<ResponseStatus<List<BusinessBean>>> getBusinessSettleRecord();

    @GET("promotion/article/get")
    Observable<ResponseStatus<LibraryInfo>> getAgreement(@Query("id") String id);

    @GET("member/user/invitedGift")
    Observable<ResponseStatus<List<LibraryInfo>>> invitedGift();

    @PUT("member/user/update")
    Observable<ResponseStatus<String>> updateUser(@Body RequestBody body);

    @GET("system/homepage/getUserInfo")
    Observable<ResponseStatus<UserDataBean>> getBusinessDetail();


    @GET("product/spu/getTenantSpuList")
    @Headers({"Accept: application/json", "Content-Type: application/json; charset=utf-8"})
    Observable<ResponseStatus<List<ProductBean>>> getTenantSpuList(@Query("status") int status);

    @PUT("product/spu/update-status")
    Observable<ResponseStatus<String>> updateGoodsStatus(@Body RequestBody body);

    /**
     * 商品核销
     *
     * @param id
     * @return
     */
    @PUT("trade/order/pick-up-by-id")
    Observable<ResponseStatus<String>> verificationSheet(@Query("id") String id);


    @POST("trade/withdrawal-record/create")
    Observable<ResponseStatus<String>> withdrawalApply(@Body RequestBody body);


    /**
     * 缺收货
     *
     * @param id
     * @return
     */
    @PUT("trade/order/receive")
    Observable<ResponseStatus<String>> receiveOrder(@Query("id") String id);

    @GET("member/user/updateLevelAndStar")
    Observable<ResponseStatus<String>> updateLevelAndStar(@Query("userId") String userId,
                                                          @Query("rank") String rank,
                                                          @Query("spId") String spId);

    @GET("member/user/getRanks")
    Observable<ResponseStatus<List<LibraryInfo>>> getRanks();

    @GET("system/tenant/queryMccList")
    Observable<ResponseStatus<List<LibraryInfo>>> queryMccList();

    @GET("product/category/getDiamonds")
    Observable<ResponseStatus<List<LibraryInfo>>> getDiamonds();


    @POST("promotion/coupon/take")
    Observable<ResponseStatus<String>> receiveTake(@Body RequestBody body);
}
